-- ================================START====================================
-- Template generated from		FRAMEWORKIVY CODE GENERATOR
-- Generator Version:			<1.0.0.0>
-- Template Creation Time:		<Thursday, 26 May, 2016   12:32:16 AM>
-- Template Modification Time:	<Monday, 23 May, 2016   11:22:57 PM>
-- Code Generation Time:		<Thursday, 26 May, 2016   1:03:36 AM>
-- Workstation ID:				<PRAVESH>
-- Current system User ID:		<pravesh kr>
-- Entity/Table Name:			<ContentBinaryDataContent>
-- Description:					<SQL Server Stored Procedure For Get All By Criteria>
-- Template File:				<IvyGodeGenDefaultTemplate V1.1.xml>

-- Please modify the generated code as per requirement.
-- This code generator is just to speed up the stereo type codes
-- Complex logic needs to be modified manually.

-- This block of comments will not be included in
-- the definition of the procedure.
-- =========================================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'Ivy_ContentManagement_ContentBinaryDataContent_GetAllByCriteria')
	BEGIN
		DROP  Procedure  [Ivy_ContentManagement_ContentBinaryDataContent_GetAllByCriteria]
	END
GO

CREATE PROCEDURE [Ivy_ContentManagement_ContentBinaryDataContent_GetAllByCriteria]
-- =========================================================================
-- Created by				FRAMEWORKIVY CODE GENERATOR
-- Generator Version:		<1.0.0.0>
-- Template version used:   <1.0>
-- Template created by:		<Mrinmoy Das>
-- Code generated by:		<pravesh kr>
-- Code generation Time:	<Thursday, 26 May, 2016   1:03:36 AM>
-- Entity/Table Name:		<ContentBinaryDataContent>
-- Description:             <SQL Server Stored Procedure For Get All By Criteria>
-- =========================================================================

-- Add the parameters for the stored procedure here

	(
			@ContentMetaDataKey int = NULL, 

			-- Binary type column should not be part of WHERE clause input parameter 
			-- @ContentBinaryData varbinary(MAX) = NULL, 

			-- Binary type column should not be part of WHERE clause input parameter 
			-- @ContentThumbnailImage varbinary(MAX) = NULL, 

			@ContentBinaryDataFileName varchar(1000) = NULL, 
			@ContentBinaryDataType varchar(1000) = NULL, 
			@ContentTotalDownloads int = NULL, 

			@Sys_ModifiedByID varchar(50) = NULL, 
			@Sys_DeleteType int = NULL, 
			@Sys_IsDeleted bit = NULL, 
			@Sys_OrganizationID int = NULL, 
			@Sys_InitialPrimaryKeys varchar(MAX) = NULL, 
			@Sys_WorkstationName varchar(50) = NULL 
	) 
AS 
BEGIN 
	-- SET NOCOUNT ON added to prevent extra result sets from interfering with SELECT statements. 
	SET NOCOUNT OFF; 

    SELECT 
			[ContentMetaDataKey], 
			[ContentBinaryData], 
			[ContentThumbnailImage], 
			[ContentBinaryDataFileName], 
			[ContentBinaryDataType], 
			[ContentTotalDownloads], 

			[Sys_DateOfCreation], 
			[Sys_DateOfModification], 
			[Sys_CreatedByID], 
			[Sys_ModifiedByID], 
			[Sys_DeleteType], 
			[Sys_IsDeleted], 
			[Sys_OrganizationID], 
			[Sys_InitialPrimaryKeys], 
			[Sys_WorkstationName] 
    FROM 
			[ContentBinaryDataContent] 
    WHERE 
		( 
			[ContentMetaDataKey] = ISNULL(@ContentMetaDataKey, [ContentMetaDataKey]) AND 

			-- Binary type column should not be part of WHERE clause input parameter 
			-- [ContentBinaryData] = ISNULL(@ContentBinaryData, [ContentBinaryData]) AND 

			-- Binary type column should not be part of WHERE clause input parameter 
			-- [ContentThumbnailImage] = ISNULL(@ContentThumbnailImage, [ContentThumbnailImage]) AND 

			[ContentBinaryDataFileName] = ISNULL(@ContentBinaryDataFileName, [ContentBinaryDataFileName]) AND 
			[ContentBinaryDataType] = ISNULL(@ContentBinaryDataType, [ContentBinaryDataType]) AND 
			[ContentTotalDownloads] = ISNULL(@ContentTotalDownloads, [ContentTotalDownloads]) AND 

			[Sys_IsDeleted] = ISNULL(@Sys_IsDeleted, [Sys_IsDeleted]) AND
			[Sys_OrganizationID] = ISNULL(@Sys_OrganizationID, [Sys_OrganizationID]) 
		); 

END 
GO 

-- =================================END=====================================

